﻿
using System.IO;
using DotNetNeural.Activation;
using DotNetNeural.Perceptron;
using DotNetNeural.Perceptron.Initialization;
namespace DotNetNeural.BackPropagation
{
    /// <summary>
    /// Common interface for perceptron
    /// </summary>
    public interface IPerceptron
    {
        int LayersCount { get; }
        int InputsCount { get; }
        int OutputsCount { get; }
        IActivationFunc ActivationFunc { get; }

        void LoadWeights(Stream s);
        void SaveWeights(Stream s);
        void InitWeights(IWeightsInitializer wFunc);
        bool CompareWeights(IPerceptron perceptron, float precision);
        void AddLayer(int neuronsCount);

        /// <summary>
        /// Propagates given input through perceptron
        /// </summary>
        float[] Propagate(float[] input);

        /// <summary>
        /// Propagates given input through peceptron and fills given context
        /// </summary>
        float[] Propagate(float[] input, IPropagationContext context);

        /// <summary>
        /// Gets perceptron's layer on given index
        /// </summary>
        float[,] this[int index] { get; }
    }
}
